import { createStore } from "vuex";

export default createStore({
  state: {
    navList: [
      {
        name: "首页",
        path: "/",
      },
      {
        name: "数据中心",
        path: "/home",
      },
    ],
  },
  getters: {},
  mutations: {
    changeNav(state, paload) {
      if (state.navList.length < 3) {
        state.navList.push(paload);
      } else {
        state.navList.pop();
        state.navList.push(paload);
      }
      console.log("likaige");
    },
  },
  actions: {},
  modules: {},
});
